<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<HTML>
<HEAD>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="${pageContext.request.contextPath}/css/Style1.css"
	rel="stylesheet" type="text/css" />
<script language="javascript"
	src="${pageContext.request.contextPath}/js/public.js"></script>
<script type="text/javascript">
	function edit(){
			
			var userState=prompt("修改用户状态(0：未激活 1：激活)"); 
			var userId=document.getElementById("userId").value;
			if(userState==0||userState==1)
			window.location.href = "${pageContext.request.contextPath}/adminUser_edit.action?userId="+userId+"&userState="+userState;
			else
			{
				alert("请输入O或1");
			}
	}
</script>
</HEAD>
<body>
	<br>
	<form id="Form1" name="Form1"
		action="${pageContext.request.contextPath}/user/list.jsp"
		method="post">
		<table cellSpacing="1" cellPadding="0" width="100%" align="center"
			bgColor="#f5fafe" border="0">
			<TBODY>
				<tr>
					<td class="ta_01" align="center" bgColor="#afd1f3"><strong>用户列表</strong></TD>
				</tr>
				
				<tr>
					<td class="ta_01" align="center" bgColor="#f5fafe">
						<table cellspacing="0" cellpadding="1" rules="all"
							bordercolor="gray" border="1" id="DataGrid1"
							style="BORDER-RIGHT: gray 1px solid; BORDER-TOP: gray 1px solid; BORDER-LEFT: gray 1px solid; WIDTH: 100%; WORD-BREAK: break-all; BORDER-BOTTOM: gray 1px solid; BORDER-COLLAPSE: collapse; BACKGROUND-COLOR: #f5fafe; WORD-WRAP: break-word">
							<tr
								style="FONT-WEIGHT: bold; FONT-SIZE: 12pt; HEIGHT: 25px; BACKGROUND-COLOR: #afd1f3">


							<tr
								style="FONT-WEIGHT: bold; FONT-SIZE: 12pt; HEIGHT: 25px; BACKGROUND-COLOR: #afd1f3">

								<td align="center" width="5%">
										序号
									</td>
									<td align="center" width="5%">
										用户昵称
									</td>
									<td align="center" width="5%">
										用户邮箱
									</td>									
									<td align="center" width="5%">
										兴趣
									</td>
								
									<td align="center" width="5%">
										注册日期
									</td>
									<td align="center" width="5%">
										状态
									</td>
									<td width="5%" align="center">
										修改用户状态
									</td>
									<td width="5%" align="center">
										删除
									</td>
								</tr></tr>
							
							<s:iterator var="u" value="pageBean.list" status="status">
							
								<tr onmouseover="this.style.backgroundColor = 'white'"
									onmouseout="this.style.backgroundColor = '#F5FAFE';">
									<!-- 序号 -->
									<td style="CURSOR: hand; HEIGHT: 22px" align="center"
										width="5%"><s:property value="#u.userId" /></td>
									<!-- 收藏计数 -->
										<td style="CURSOR: hand; HEIGHT: 22px" align="center"
										width="10%"><s:property value="#u.nickName" /></td>
									<!-- 用户邮箱 -->
										<td style="CURSOR: hand; HEIGHT: 22px" align="center"
										width="10%"><s:property value="#u.userName" /></td>
									<!-- 兴趣 -->	
										<td style="CURSOR: hand; HEIGHT: 22px" align="center"
										width="10%"><s:property value="#u.userHobby" /></td>
									
									<!-- 注册日期 -->
										<td style="CURSOR: hand; HEIGHT: 22px" align="center"
										width="10%"><s:property value="#u.userDate" /></td>
									<!-- 状态 -->
									<s:if test="#u.userState==1">
										<td style="CURSOR: hand; HEIGHT: 22px" align="center"
											width="5%">激活
										</td>
									</s:if>
									<s:else>
										<td style="CURSOR: hand; HEIGHT: 22px" align="center"
											width="5%">未激活
										</td>
									</s:else>
										
									<td align="center" style="HEIGHT: 22px">
									
								
									<button type="button" id="userId" name="add" value="<s:property value="#u.userId"/>" 
									class="button_add" onclick="edit()">
											修改
										<img src="${pageContext.request.contextPath}/images/i_edit.gif"	border="0" style="CURSOR: hand">
						
									</button>
									
										
										
									
									</td>

									<td align="center" style="HEIGHT: 22px"><a
										href="${pageContext.request.contextPath}/adminUser_delete.action?userId=<s:property value="#u.userId"/>">
											<img
											src="${pageContext.request.contextPath}/images/i_del.gif"
											width="16" height="16" border="0" style="CURSOR: hand">
									</a></td>
								</tr>
							</s:iterator>
						</table>
					</td>
				</tr>
				<tr align="center">
					<td class="ta_01" align="center" bgColor="#afd1f3">
						
							<s:if test="pageBean.page!=1">
							<a href="adminUser_findAllByPage.action?page=1">首页</a>
							<a href="adminUser_findAllByPage.action?page=<s:property value="pageBean.page-1"/>">上一页</a>
							</s:if>
							<s:else>
								<font>首页</font>
								<font>上一页</font>
							</s:else>
							&nbsp;&nbsp;第<s:property value="pageBean.page"/>/<s:property value="pageBean.totalPage"/>页&nbsp;&nbsp;
							<s:if test="pageBean.page!=pageBean.totalPage">
							<a href="adminUser_findAllByPage.action?page=<s:property value="pageBean.page+1"/>">下一页</a>
							<a href="adminUser_findAllByPage.action?page=<s:property value="pageBean.totalPage"/>">尾页</a>
							</s:if>
							<s:else>
								<font>下一页</font>
								<font>尾页</font>
							</s:else>
					</td>
				</tr>
			</TBODY>
		</table>
	</form>
</body>
</HTML>

